package com.mashibing.juc.c_000;

import java.util.concurrent.TimeUnit;

/**
 * @author: Yuanzt
 * @Date: 2021/3/24
 */
public class T01_WhatIsThread {

    static class MyThread extends Thread{
        @Override
        public void run(){
            for (int i=0;i<10;i++){
                try {
                    TimeUnit.SECONDS.sleep(1);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("myThread");
            }
        }
    }

    public static void main(String[] args) {
        MyThread thread = new MyThread();
        thread.start();
        for (int i=0 ;i<10;i++){
            try {
                TimeUnit.SECONDS.sleep(1);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("main");
        }
    }

}
